<?php

use kartik\form\ActiveForm;
use yii\bootstrap\Html;
use wodrow\yii2wtools\tools\JsBlock;
use yii\helpers\Url;
use common\Tools;


/* @var $this yii\web\View */
/* @var $model \fztadmin\modules\rbac\models\forms\UserInvite */

?>
<div class="user-create">
    <div class="text-warning">点击创建邀请链接会生成一个给用户注册用的邀请页面链接，生成的链接24小时有效，仅能使用一次</div>
    <?php $form = ActiveForm::begin(); ?>
    <?=$form->field($model, 'code')->hiddenInput()->label(false); ?>
    <?=$form->field($model, 'period')->hiddenInput(['value' => 86400])->label(false); ?>
    <?=$form->field($model, 'status')->hiddenInput(['value' => $model::STATUS_ACTIVE])->label(false); ?>
    <?php if (!Yii::$app->request->isAjax){ ?>
        <div class="form-group">
            <?= Html::submitButton(Yii::t('app', '创建邀请链接'), ['class' => 'btn btn-primary']) ?>
        </div>
    <?php } ?>
    <?php ActiveForm::end(); ?>
</div>

<?php JsBlock::begin(); ?>
    <script>
        $(function (){});
    </script>
<?php JsBlock::end(); ?>